package br.com.cnpv.modelo.dao;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;

import br.com.cnpv.modelo.acesso.idao.IModeloDAO;
import br.com.cnpv.modelo.entity.Modelo;

public class ModeloDAO implements IModeloDAO{

	@SuppressWarnings("unchecked")
	@Override
	public List<Modelo> listarPorMarca(int idMarca, Session session)
			throws HibernateException {
		Query query = session.getNamedQuery("Modelo.listarPorMarca");
		query.setInteger("idMarca", idMarca);
		
		return query.list();
	}
}